<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="../../template/template.xhtml">
	<ui:define name="content">
		<div class="FORM_HEADER">Phone Numbers</div>
		<h:form id="form1">
			<h:panelGrid columns="3" styleClass="APPLICATION_CONTENT">
				<h:outputLabel value="Phone Number: " for="phoneNumber" />
				<h:inputText id="phoneNumber"
					value="#{studentController.phoneDTO.phoneNumber}" size="55" />
				<h:message for="phoneNumber" errorClass="ERROR_MESSAGE" />

				<h:outputLabel value="Description: " for="description" />
				<h:inputTextarea id="description" cols="55" rows="8"
					value="#{studentController.phoneDTO.description}" />
				<h:message for="description" errorClass="ERROR_MESSAGE" />

				<h:outputText value="" />
				<p:commandButton value="Save"
					action="#{studentController.updatePhone}" update="@form">
				</p:commandButton>
			</h:panelGrid>

			<h:dataTable id="phoneTable"
				value="#{studentController.phoneDTOList}" var="phone"
				styleClass="TABLE_BASIC_COMPOSITION" headerClass="TABLE_HEADER"
				rowClasses="ODD_ROW, EVEN_ROW" cellpadding="8" width="100%">
				<h:column>
					<f:facet name="header">Phone No.</f:facet>
					<h:outputText value="#{phone.phoneNumber}" />
				</h:column>
				<h:column>
					<f:facet name="header">Description</f:facet>
					<h:outputText value="#{phone.description}" />
				</h:column>
			</h:dataTable>
		</h:form>
	</ui:define>
</ui:composition>
</html>